package com.mercury.user.controller;


import com.mercury.user.entity.VO.ExchangeItemInfo;
import com.mercury.user.entity.VO.UserInfoVo;
import com.mercury.user.service.CenterMallUserService;
import com.mercury.util.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tong
 * @since 2021-11-22
 */
@RestController
@RequestMapping("/user/center-mall-user")
public class CenterMallUserController {
    @Autowired
    private CenterMallUserService mallUserService;

    @GetMapping("/exchangeList/{userId}")
    @ApiOperation(value = "获得用户的兑换列表")
    public R exchangeList(@PathVariable String userId) {
        List<ExchangeItemInfo> exchangeList = mallUserService.getExchangeList(userId);
        return R.ok().data("exchangeList",exchangeList);

    }

}

